<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>isGeneratorFunction</title>
</head>

<body>
    <script>
        const isGeneratorFunction = val =>
            Object.prototype.toString.call(val) === '[object GeneratorFunction]';
        document.write(`isGeneratorFunction(function* () {})的结果是:${isGeneratorFunction(function* () { })}`)
    </script>
</body>

</html>